/**
 * 
 */
package org.jackysoft.opensymphony.workflow.basic;

import java.io.Serializable;
import java.util.Date;

import org.jackysoft.entity.Step;
import org.jackysoft.opensymphony.workflow.entity.SimpleStep;


/**
 * @author SERVER56
 *
 */
public class BasicStep implements Step , Serializable{
    
	private Date dueDate;
    private Date finishDate;
    private Date startDate;
    private String caller;
    private String owner;
    private String status;
    private long[] previousStepIds;
    private int actionId;
    private int stepId;
    private long entryId;
    private long id;
    public BasicStep(final SimpleStep step){
    	this.id = step.getId();
        this.entryId = step.getEntryId();
        this.stepId = step.getStepId();
        this.actionId = step.getActionId();
        this.owner = step.getOwner();
        this.startDate = step.getStartDate();
        this.finishDate = step.getFinishDate();
        this.dueDate = step.getDueDate();
        this.status = step.getStatus();
        this.previousStepIds = step.getPreviousStepIds();
        this.caller = step.getCaller();
    }
    public BasicStep(final long id, final long entryId, final int stepId, final int actionId, final String owner, final Date startDate, final Date dueDate, final Date finishDate, final String status, final long[] previousStepIds, final String caller) {
        this.id = id;
        this.entryId = entryId;
        this.stepId = stepId;
        this.actionId = actionId;
        this.owner = owner;
        this.startDate = startDate;
        this.finishDate = finishDate;
        this.dueDate = dueDate;
        this.status = status;
        this.previousStepIds = previousStepIds;
        this.caller = caller;
    }

    
	public int getActionId() {
		return actionId;
	}

	public void setActionId(final int actionId) {
		this.actionId = actionId;
	}

	public String getCaller() {
		return caller;
	}

	public void setCaller(final String caller) {
		this.caller = caller;
	}

	public Date getDueDate() {
		return dueDate;
	}

	public void setDueDate(final Date dueDate) {
		this.dueDate = dueDate;
	}

	public long getEntryId() {
		return entryId;
	}

	public void setEntryId(final long entryId) {
		this.entryId = entryId;
	}

	public Date getFinishDate() {
		return finishDate;
	}

	public void setFinishDate(final Date finishDate) {
		this.finishDate = finishDate;
	}

	public long getId() {
		return id;
	}

	public void setId(final long id) {
		this.id = id;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(final String owner) {
		this.owner = owner;
	}

	public long[] getPreviousStepIds() {
		return previousStepIds;
	}

	public void setPreviousStepIds(final long[] previousStepIds) {
		this.previousStepIds = previousStepIds;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(final Date startDate) {
		this.startDate = startDate;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(final String status) {
		this.status = status;
	}

	public int getStepId() {
		return stepId;
	}

	public void setStepId(final int stepId) {
		this.stepId = stepId;
	}

	@Override
	public boolean equals(final Object obj) {
		//2006-8-23
		if(obj != null
		   && obj instanceof BasicStep
		   && ((BasicStep)obj).getId() == this.id){
			return true;
		}else{
			return false;
		}	
	}

	@Override
	public int hashCode() {
		//2006-8-23
		return Integer.parseInt(new Long(this.getId()).toString());
	}

	

}
